package com.atguigu.spzx.manager.controler;


import com.atguigu.spzx.manager.service.ArticleCateService;
import com.atguigu.spzx.model.dto.system.SysArticle;
import com.atguigu.spzx.model.vo.article.ArticleCate;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Tag(name="文章分类")
@RestController
@RequestMapping(value = "/admin/article")
public class articleCateController {

  @Autowired
    private ArticleCateService articleCateService;

  @PostMapping("/list/{current}/{limit}")
  public Result findByPage(@PathVariable("current") Integer current,
                           @PathVariable("limit")  Integer limit,
                           @RequestBody SysArticle sysArticle){
      PageInfo<ArticleCate> pageInfo=articleCateService.findByPage(sysArticle,current,limit);

      return  Result.build(pageInfo, ResultCodeEnum.SUCCESS);
  }

}
